﻿<phone:PhoneApplicationPage 
    x:Class="ConfApp.Views.SessionDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:Behaviours="clr-namespace:ConfApp.Infrastructure.Behaviours" xmlns:CustomControls="clr-namespace:Phone.Controls;assembly=Phone.Controls" xmlns:Preview="clr-namespace:Phone7.Fx.Preview;assembly=Phone7.Fx.Preview" mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    DataContext="{Binding Source={StaticResource ViewModelLocator}, Path=SessionDetailsViewModel}"
    shell:SystemTray.IsVisible="True">

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot Title="SINERGIJA 11">
            <!--Pivot item one-->
            <controls:PivotItem Header="opis">
                <StackPanel x:Name="ContentPanel" Margin="12,0,12,0">
                    <Grid Margin="{StaticResource PhoneTouchTargetOverhang}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="3"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Rectangle Grid.Column="0" Margin="12,0,-12,0" Fill="{Binding TrackColor}"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                        <StackPanel Grid.Column="1" Margin="12,0" VerticalAlignment="Top">
                            <TextBlock Text="{Binding Title}" Style="{StaticResource PhoneTextLargeStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Margin="12,-12,12,6"/>
                            <TextBlock Text="{Binding MinorInfo}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilyNormal}"/>
                            <TextBlock Text="{Binding SlotInfo}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilyNormal}"/>
                        </StackPanel>
                    </Grid>
                    <CustomControls:ScrollableTextBlock  
                            Text="{Binding Description}"           
                            HorizontalAlignment="Left"   
                            VerticalAlignment="Top" 
                            Height="339" 
                            Width="409" 
                            Margin="24,6,0,0"
                             />
                </StackPanel>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="predavači">
                <ListBox ItemsSource="{Binding SessionSpeakerInfos}" x:Name="speakers">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid Margin="{StaticResource PhoneTouchTargetOverhang}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Image Width="110" Height="150" Source="{Binding Picture}" VerticalAlignment="Top"/>
                                <StackPanel Grid.Column="1" VerticalAlignment="Top">
                                    <TextBlock Text="{Binding FullName}" Style="{StaticResource PhoneTextLargeStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Margin="12,-12,12,6"/>
                                    <TextBlock Text="{Binding Employer}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
                                </StackPanel>
                                <Custom:Interaction.Triggers>
                                    <Custom:EventTrigger EventName="Tap">
                                        <Custom:InvokeCommandAction Command="{Binding Path=DataContext.SpeakerSelectedCommand, ElementName=speakers}" CommandParameter="{Binding}"/>
                                    </Custom:EventTrigger>
                                </Custom:Interaction.Triggers>
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>    
                </ListBox>
            </controls:PivotItem>
        </controls:Pivot>
        <!--Sample code showing usage of ApplicationBar-->
        <Preview:BindableApplicationBar x:Name="AppBar" BarOpacity="1.0">
            <Preview:BindableApplicationBarIconButton 
                Command="{Binding ToggleFavCommand}"
                Text="{Binding AppBarFavText}" 
                IconUri="{Binding AppBarFavIconUrl}" />
            <Preview:BindableApplicationBarIconButton 
                Command="{Binding MapCommand}"
                Text="na mapi" 
                IconUri="/Resources/Icons/appbar.nav.rest.png" />

            <!--{Binding AppBarFavIconUrl}-->
        </Preview:BindableApplicationBar>
    </Grid>    
</phone:PhoneApplicationPage>